<?php
class PNAjaxDistrictArray extends PNObjectExArray {
  function PNAjaxDistrictArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'icarrent_district';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }
  function genSort(){
    return " ORDER BY dis_name ASC";
  }

  function genFilter(){
    $province_id  = FormUtil::getPassedValue ('province_id', false);

    $wheres = array();

    //filter by selector
    if ($province_id && intval($province_id)) $wheres[] = "dis_prov_id ='$province_id'";

    return implode(' AND ', $wheres) ;
  }

}